Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOFormatExpression

Inherits From:	NSObject

Conforms To:	NSCopying

Declared In:	eoaccess/EOFormatExpression.h 

Class Description

An EOFormatExpression is used to substitute a special character sequence in a format string with an object's expression value (as defined in the EOExpression informal protocol specification). It's used internally by the Framework in the generation of SQL; unless you're implementing an adaptor, you should never need to create or use one yourself.

When asked for its expression value, an EOFormatExpression returns an NSString containing the format string with which it was created, with each occurrence of the percent sign followed by a ªmagic characterº replaced by the expression value of the object with which the EOFormatExpression was created (ª%%º is replaced by a single percent sign). For example, if an EOFormatExpression is created with the following items:

expression value	3000.00
format string	salary = %V
magic character	V

its expression value is:

salary = 3000.00

Instance Variables

None declared in this class.

Adopted Protocols

NSCopying	- copy
- copyWithZone:

Instance Methods

expressionValueForContext:

- (NSString *)expressionValueForContext:(id <EOExpressionContext>)context

Returns the receiver's format string with substitutions made as explained in the class description. Sends the receiver's expression object an expressionValueForContext: message, with context, to get the value to substitute. This method otherwise ignores the context argument.

initWithExpression:format:magicCharacter:

- initWithExpression:expression
format:(NSString *)format
magicCharacter:(unichar)magicCharacter

Initializes the receiver, a newly allocated instance of EOFormatExpression, to substitute expression's expression value within format at each occurrence of a percent sign followed by magicCharacter. This is the designated initializer for the EOFormatExpression class. Returns self.